﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true"
    CodeBehind="BuildingsStatisticsReport.aspx.cs" Inherits="DTGroup_ZheJiang.WebUI.List.BuildingsStatisticsReport" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../js/AlertBox.js" type="text/javascript"></script>
    <script src="../js/LightBox.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#btnConfirm").click(function () {
            })
        });
        var boxcallback = function (callbackParameter) { };
        function onSearch() {
            var ddlType = $("#ddlType").val();
            var ddlCity = $("#ddlCity").val();
            var ReportTime = $("#ReportTime").val();

            var txtminmrcount = $("#txtminmrcount").val();
            var txtmaxmrcount = $("#txtmaxmrcount").val();
            var txtminweakmrcount = $("#txtminweakmrcount").val();
            var txtmaxweakmrcount = $("#txtmaxweakmrcount").val();
            var txtminmrrsrp = $("#txtminmrrsrp").val();
            var txtmaxmrrsrp = $("#txtmaxmrrsrp").val();
            var roundNumber = txtminmrcount + "," + txtmaxmrcount + "," + txtminweakmrcount + "," + txtmaxweakmrcount + "," + txtminmrrsrp + "," + txtmaxmrrsrp;

            if (ReportTime == "" || ReportTime == null) {
                alertBox(boxcallback, "0", "提示", "请输入起始日期");
                return;
            }
            if (isNaN(txtminmrcount) || isNaN(txtmaxmrcount) || isNaN(txtminweakmrcount) || isNaN(txtmaxweakmrcount) || isNaN(txtminmrrsrp) || isNaN(txtmaxmrrsrp)) {
                alertBox(boxcallback, "0", "提示", "请输入正确数字");
                return;
            }
            var url = "?Options=Search&ddlType=" + ddlType + "&ddlCity=" + ddlCity + "&ReportTime=" + ReportTime + "&roundNumber=" + roundNumber;
            location.href = url + "#Menu=0";

        }
        function onExport() {
            var ddlType = $("#ddlType").val();
            var ddlCity = $("#ddlCity").val();
            var ReportTime = $("#ReportTime").val();

            var txtminmrcount = $("#txtminmrcount").val();
            var txtmaxmrcount = $("#txtmaxmrcount").val();
            var txtminweakmrcount = $("#txtminweakmrcount").val();
            var txtmaxweakmrcount = $("#txtmaxweakmrcount").val();
            var txtminmrrsrp = $("#txtminmrrsrp").val();
            var txtmaxmrrsrp = $("#txtmaxmrrsrp").val();
            var roundNumber = txtminmrcount + "," + txtmaxmrcount + "," + txtminweakmrcount + "," + txtmaxweakmrcount + "," + txtminmrrsrp + "," + txtmaxmrrsrp;

            if (ReportTime == "" || ReportTime == null) {
                alertBox(boxcallback, "0", "提示", "请输入起始日期");
                return;
            }
            if (isNaN(txtminmrcount) || isNaN(txtmaxmrcount) || isNaN(txtminweakmrcount) || isNaN(txtmaxweakmrcount) || isNaN(txtminmrrsrp) || isNaN(txtmaxmrrsrp)) {
                alertBox(boxcallback, "0", "提示", "请输入正确数字");
                return;
            }

            $.ajax({
                type: "POST",
                contentType: "application/x-www-form-urlencoded",
                data: { Options: "Export", ddlType: ddlType, ddlCity: ddlCity, ReportTime: ReportTime, roundNumber: roundNumber },
                url: "/List/BuildingsStatisticsReport.aspx",
                success: function (data) {
                    var arr = data.split(',');
                    ExportFile(arr[0], arr[1]);
                },
                error: function (exh, e) {
                    alertBox(boxcallback, "0", "提示", "系统异常，请稍后重试")
                    return false;
                }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="selectBox">
        <span>数据源：</span>
        <select id="ddlType">
            <option value="ALL" <%if (Request["ddlType"] == "ALL"){ %> selected="selected" <%} %>>
                全量</option>
            <option value="OTT" <%if (Request["ddlType"] == "OTT"){ %> selected="selected" <%} %>>
                OTT</option>
        </select>
        <span>地市：</span>
        <select id="ddlCity">
            <option value="hangzhou" <%if (Request["ddlCity"] == "hangzhou"){ %> selected="selected"
                <%} %>>杭州</option>
            <option value="ningbo" <%if (Request["ddlCity"] == "ningbo"){ %> selected="selected"
                <%} %>>宁波</option>
            <option value="wenzhou" <%if (Request["ddlCity"] == "wenzhou"){ %> selected="selected"
                <%} %>>温州</option>
            <option value="shaoxing" <%if (Request["ddlCity"] == "shaoxing"){ %> selected="selected"
                <%} %>>绍兴</option>
            <option value="huzhou" <%if (Request["ddlCity"] == "huzhou"){ %> selected="selected"
                <%} %>>湖州</option>
            <option value="jiaxing" <%if (Request["ddlCity"] == "jiaxing"){ %> selected="selected"
                <%} %>>嘉兴</option>
            <option value="jinhua" <%if (Request["ddlCity"] == "jinhua"){ %> selected="selected"
                <%} %>>金华</option>
            <option value="quzhou" <%if (Request["ddlCity"] == "quzhou"){ %> selected="selected"
                <%} %>>衢州</option>
            <option value="taizhou" <%if (Request["ddlCity"] == "taizhou"){ %> selected="selected"
                <%} %>>台州</option>
            <option value="lishui" <%if (Request["ddlCity"] == "lishui"){ %> selected="selected"
                <%} %>>丽水</option>
            <option value="zhoushan" <%if (Request["ddlCity"] == "zhoushan"){ %> selected="selected"
                <%} %>>舟山</option>
        </select>
        <span>开始时间：</span>
        <input type="text" id="ReportTime" value="<%=Request["ReportTime"] %>" />
        <br />
        <span>MR总数范围：</span>
        <input type="text" id="txtminmrcount" value="<%=Request["roundNumber"]==null?"":Request["roundNumber"].Split(',').Length>=2?Request["roundNumber"].Split(',')[0]:"" %>"
            style="width: 40px" />
        ~
        <input type="text" id="txtmaxmrcount" value="<%=Request["roundNumber"]==null?"":Request["roundNumber"].Split(',').Length>=2?Request["roundNumber"].Split(',')[1]:"" %>"
            style="width: 40px" />
        <span>MR覆盖率范围：</span>
        <input type="text" id="txtminweakmrcount" value="<%=Request["roundNumber"]==null?"":Request["roundNumber"].Split(',').Length>=2?Request["roundNumber"].Split(',')[2]:"" %>"
            style="width: 40px" />
        ~
        <input type="text" id="txtmaxweakmrcount" value="<%=Request["roundNumber"]==null?"":Request["roundNumber"].Split(',').Length>=2?Request["roundNumber"].Split(',')[3]:"" %>"
            style="width: 40px" />
        <span>MR电平值范围：</span>
        <input type="text" id="txtminmrrsrp" value="<%=Request["roundNumber"]==null?"":Request["roundNumber"].Split(',').Length>=2?Request["roundNumber"].Split(',')[4]:"" %>"
            style="width: 40px" />
        ~
        <input type="text" id="txtmaxmrrsrp" value="<%=Request["roundNumber"]==null?"":Request["roundNumber"].Split(',').Length>=2?Request["roundNumber"].Split(',')[5]:"" %>"
            style="width: 40px" />
        <span id="btnConfirm" class="btnConfirm" onclick="onSearch()">确定</span> <span id="btnExport"
            class="btnConfirm" onclick="onExport()">导出</span>
        <br />
    </div>
    <div class="rightTableHeight" style="overflow-x: scroll">
        <table id="example" class="data display " style="width: 2500px">
            <thead>
                <tr style="border-bottom: 1px solid #f6f6f6;">
                    <th>
                        日期
                    </th>
                    <th>
                        城市
                    </th>
                    <th>
                        建筑物编号
                    </th>
                    <th>
                        建筑物名称
                    </th>
                    <th>
                        建筑物经度
                    </th>
                    <th>
                        建筑物纬度
                    </th>
                    <th>
                        栅格总数
                    </th>
                    <th>
                        弱覆盖栅格数
                    </th>
                    <th>
                        弱覆盖栅格率
                    </th>
                    <th>
                        无栅格数
                    </th>
                    <th>
                        无栅格率
                    </th>
                    <th>
                        MR总数
                    </th>
                    <th>
                        MR弱覆盖数
                    </th>
                    <th>
                        MR平均RSRP
                    </th>
                    <th>
                        MR覆盖率
                    </th>
                    <th>
                        S_CELL1
                    </th>
                    <th>
                        S_CELL1 采样点数
                    </th>
                    <th>
                        S_CELL1 弱覆盖采样点数
                    </th>
                    <th>
                        S_CELL2
                    </th>
                    <th>
                        S_CELL2 采样点数
                    </th>
                    <th>
                        S_CELL2 弱覆盖采样点数
                    </th>
                    <th>
                        S_CELL3
                    </th>
                    <th>
                        S_CELL3 采样点数
                    </th>
                    <th>
                        S_CELL3 弱覆盖采样点数
                    </th>
                    <th>
                        有无室分
                    </th>
                </tr>
            </thead>
            <tbody>
                <% foreach (System.Data.DataRow row in dataSource.Rows)
                   { %>
                <tr class="odd gradeX">
                    <td>
                        <%=Convert.ToDateTime(row["P_Day"]).ToString("yyyy-MM-dd")%>
                    </td>
                    <td>
                        <%=row["City"]%>
                    </td>
                    <td>
                        <%=row["BuildingId"]%>
                    </td>
                    <td>
                        <%=row["BuildingName"]==null?"":row["BuildingName"].ToString().Length >= 10 ? row["BuildingName"].ToString().Substring(0, 10) : row["BuildingName"]%>
                    </td>
                    <td>
                        <%=row["Longitude"]%>
                    </td>
                    <td>
                        <%=row["Latitude"]%>
                    </td>
                    <td>
                        <%=row["GridCount"]%>
                    </td>
                    <td>
                        <%=row["WeakGridCount"]%>
                    </td>
                    <td>
                        <%=row["WeakGridPercent"]%>
                    </td>
                    <td>
                        <%=row["NoGridCount"]%>
                    </td>
                    <td>
                        <%=row["NoGridPercent"]%>
                    </td>
                    <td>
                        <%=row["MRCount"]%>
                    </td>
                    <td>
                        <%=row["WeakMrCount"]%>
                    </td>
                    <td>
                        <%=row["AvgMRRsrp"]%>
                    </td>
                    <td>
                        <%=row["MRCoverPercent"]%>
                    </td>
                    <td>
                        <%=row["S_CELL1"]%>
                    </td>
                    <td>
                        <%=row["S_CELL1_MRCount"]%>
                    </td>
                    <td>
                        <%=row["S_CELL1_WeakMRCount"]%>
                    </td>
                    <td>
                        <%=row["S_CELL2"]%>
                    </td>
                    <td>
                        <%=row["S_CELL2_MRCount"]%>
                    </td>
                    <td>
                        <%=row["S_CELL2_WeakMRCount"]%>
                    </td>
                    <td>
                        <%=row["S_CELL3"]%>
                    </td>
                    <td>
                        <%=row["S_CELL3_MRCount"]%>
                    </td>
                    <td>
                        <%=row["S_CELL3_WeakMRCount"]%>
                    </td>
                    <td>
                        <%=row["HasInDoor"].ToString().Trim()=="0"?"否":"是"%>
                    </td>
                </tr>
                <%} %>
            </tbody>
        </table>
    </div>
    <%=DTGroup.Networking.Framework.Utils.Web.Pager.Html(TotalCount, PageIndex, PageSize, "")%>
</asp:Content>
